package demo3;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        UserDAo userDAo = new UserDAo();
        System.out.println(userDAo);

        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext("demo3");
        UserDAo userDAo1 = context.getBean(UserDAo.class);
        System.out.println(userDAo1);

        Person p1 = new Person();
        p1.setName("王克晶");
        p1.setAge(18);
        System.out.println(p1);

        Person p2 = context.getBean(Person.class);
        System.out.println(p2);
    }
}
